package com.wuhao.code.check.style.arrangement

import com.intellij.psi.codeStyle.arrangement.std.StdArrangementTokens.EntryType.*
import com.intellij.psi.codeStyle.arrangement.std.StdArrangementTokens.Modifier.*
import com.intellij.psi.codeStyle.arrangement.std.StdArrangementTokens.Order.KEEP

/**
 * java代码排序规则列表
 * @author 吴昊
 * @since 1.3.1
 */
object JavaRearrangeRules : BaseRules() {

  override fun get(): List<RuleDescription> {
    return listOf(
        RuleDescription(listOf(FIELD, PUBLIC, STATIC, FINAL), KEEP),
        RuleDescription(listOf(FIELD, PROTECTED, STATIC, FINAL), KEEP),
        RuleDescription(listOf(FIELD, PACKAGE_PRIVATE, STATIC, FINAL), KEEP),
        RuleDescription(listOf(FIELD, PRIVATE, STATIC, FINAL), KEEP),
        RuleDescription(listOf(FIELD, PUBLIC, STATIC), KEEP),
        RuleDescription(listOf(FIELD, PROTECTED, STATIC), KEEP),
        RuleDescription(listOf(FIELD, PACKAGE_PRIVATE, STATIC), KEEP),
        RuleDescription(listOf(FIELD, PRIVATE, STATIC), KEEP),
        RuleDescription(listOf(INIT_BLOCK, STATIC)),
        RuleDescription(listOf(FIELD, PUBLIC, FINAL), KEEP),
        RuleDescription(listOf(FIELD, PROTECTED, FINAL), KEEP),
        RuleDescription(listOf(FIELD, PACKAGE_PRIVATE, FINAL), KEEP),
        RuleDescription(listOf(FIELD, PRIVATE, FINAL), KEEP),

        RuleDescription(listOf(FIELD, PUBLIC), KEEP),
        RuleDescription(listOf(FIELD, PROTECTED), KEEP),
        RuleDescription(listOf(FIELD, PACKAGE_PRIVATE), KEEP),
        RuleDescription(listOf(FIELD, PRIVATE), KEEP),
        RuleDescription(FIELD, KEEP),
        RuleDescription(INIT_BLOCK),
        RuleDescription(CONSTRUCTOR),

        RuleDescription(listOf(METHOD, PUBLIC, STATIC, FINAL), KEEP),
        RuleDescription(listOf(METHOD, PACKAGE_PRIVATE, STATIC, FINAL), KEEP),
        RuleDescription(listOf(METHOD, PROTECTED, STATIC, FINAL), KEEP),
        RuleDescription(listOf(METHOD, PRIVATE, STATIC, FINAL), KEEP),

        RuleDescription(listOf(METHOD, PUBLIC, STATIC), KEEP),
        RuleDescription(listOf(METHOD, PACKAGE_PRIVATE, STATIC), KEEP),
        RuleDescription(listOf(METHOD, PROTECTED, STATIC), KEEP),
        RuleDescription(listOf(METHOD, PRIVATE, STATIC), KEEP),
        RuleDescription(listOf(METHOD, PUBLIC, FINAL), KEEP),
        RuleDescription(listOf(METHOD, PACKAGE_PRIVATE, FINAL), KEEP),
        RuleDescription(listOf(METHOD, PROTECTED, FINAL), KEEP),
        RuleDescription(listOf(METHOD, PRIVATE, FINAL), KEEP),
        RuleDescription(listOf(METHOD, PUBLIC), KEEP),
        RuleDescription(listOf(METHOD, PACKAGE_PRIVATE), KEEP),
        RuleDescription(listOf(METHOD, PROTECTED), KEEP),
        RuleDescription(listOf(METHOD, PRIVATE), KEEP),
        RuleDescription(METHOD, KEEP),
        RuleDescription(ENUM, KEEP),
        RuleDescription(INTERFACE, KEEP),
        RuleDescription(listOf(CLASS, STATIC), KEEP),
        RuleDescription(listOf(CLASS, CLASS), KEEP))
  }

}

